package com.bnz.controller;

import com.bnz.pojo.R;
import com.bnz.pojo.Student;
import com.bnz.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/student")
public class StudentController {

    @Autowired
    private IStudentService studentService;

    @GetMapping("/list")
    public R list(){
        //1.1 查询所有学生
        List<Student> studentList = studentService.list();
        //1.2 返回
        return R.ok().data("list",studentList);
    }


}
